package org.ying.container.aop;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Arrays;

public interface Aspect {

    Result before(Object target, Method method, Object[] args);


    Result after(Object target, Method method, Object[] args);


    Result afterException(Object target, Method method, Object[] args, Throwable e);

    class Result{
        //是否需要继续往下执行
        private boolean toNext;
        //一般不往下执行的时候会返回一个对象
        private Object object;

        public Result(boolean toNext, Object object) {
            this.toNext = toNext;
            this.object = object;
        }

        public boolean getToNext() {
            return toNext;
        }

        public Object getObject() {
            return object;
        }
    }
}
